﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Security
{
    /// <summary>
    /// 
    /// </summary>
    public class HMACMD5CryptoService : KeyedHashCryptoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACMD5CryptoService(string key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACMD5CryptoService(byte[] key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override HashAlgorithm CreateAlgorithm()
        {
            return new HMACMD5(this.Key);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public class HMACSHA1CryptoService : KeyedHashCryptoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA1CryptoService(string key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA1CryptoService(byte[] key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override HashAlgorithm CreateAlgorithm()
        {

            return new HMACSHA1(this.Key);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public class HMACSHA256CryptoService : KeyedHashCryptoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA256CryptoService(string key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA256CryptoService(byte[] key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override HashAlgorithm CreateAlgorithm()
        {

            return new HMACSHA256(this.Key);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public class HMACSHA384CryptoService : KeyedHashCryptoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA384CryptoService(string key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA384CryptoService(byte[] key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override HashAlgorithm CreateAlgorithm()
        {

            return new HMACSHA384(this.Key);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public class HMACSHA512CryptoService : KeyedHashCryptoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA512CryptoService(string key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        public HMACSHA512CryptoService(byte[] key) : base(key)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override HashAlgorithm CreateAlgorithm()
        {

            return new HMACSHA512(this.Key);
        }
    }
}
